Original: A Egil refsnes translation: Atzie
Two. Transformation of XSL
1. Convert XML to HTMLHow does XSL convert an XML document into an HTML file? Let's take a look at an example where the following is part of an XML document:
...
We then convert the XML data to an HTML file as an HTML template for the following XSL
Programmers who use the new version of eclipse indigo to develop Android have probably encountered a problem similar to me: Android program development involves various XML resources. After opening the XML file for editing and saving, eclipse indigo runs directly accidentally, opens XSL transformation intelligently to run XML, and automatically generates an out button next to the XML file. XML file, causing
Import javax. xml. transform .*;
Import javax. xml. transform. stream .*;
/**
* TransformDemo uses JAXP to acquire an XML Transformer. It uses the Transformer
* To transform an XML shopping cart into an HTML view of the shopping cart.
* The Transformer uses transform instructions in an XSLT (. xsl) file.
*
* The following JARs must be in your CLASSPATH:
*-Jaxp. jar
*-Xerces. jar (for SAX parser and DOM object implementations)
*-Xalan. jar (for XSLT i
data. (for example, show negative numbers in red.) 3.XSL---What does it do? XSL can be used to define how an XML document is displayed, to convert an XML document into an HTML file that can be recognized by the browser, and typically XSL to implement this transformation by translating each XML element into an HTML
An introduction to XSL
1.XSL---style sheet for XML
HTML Web pages use predefined identities (tags), which means that all tags have a clear meaning, such as However, XML does not have a fixed identity, we can build the identity we need, so browsers can't parse them automatically, for example In order to control the display of XML documents, it is necessary to establish a mechanism, CSS is one of them, bu
What is XSL
Full name extensible Style Language, Chinese translation extended style language, used to format XML documents, it consists of two parts.
1 (XSLT): XSL transformation Language (XSLT), which converts an XML document from one format to another. such as converting to HTML, text, or text-based documents.
2 (XPath): XS
Tutorials | transformations
Two. Transformation of XSL
1. Convert XML to HTMLHow does XSL convert an XML document into an HTML file? Let's take a look at an example where the following is part of an XML document:
USA
Columbia
...
We then convert the XML data to an HTML file a
The XSL-FO applies a rectangular box (area) to display the output. The XSL pattern model of the XSL-FO area defines a series of rectangular (area) boxes to display the output. All outputs are formatted into these boxes and then displayed or printed to a target media.
The XSL-FO applies a rectangular box (area) to displ
XSL
XSL refers to the Extensible Stylesheet Language. It is a language used to present XML data in readable format.
Directory
Introduction
Syntax
Whether XSL is the same as XML
Purpose
Application
Introduction
XSL is for XML, just like CSS for HTML. It refers to
XML version = "1.0" encoding = "gb2312"
?>
XML-stylesheet type = "text/XSL" href = "Copy. XSL"
?>
Product Series
>
Product
>
Model
>
Mag xj570
Model
>
Imaging tube level = "0
. 24mm "vertical
= "0.12"
Dimensions
= "15"
>
0.28 extremely fine to Point
Picture Tube
>
Control
>
Visual onview view math
Control
>
The XSL-FO defines the output within the fo: flow element. The XSL-FO Page, Flow, and Block content blocks Flow into the Page and then output to the media. XSL-FO output is usually nested in the fo: block element, the fo: block is nested in the fo: flow element, and the fo: flow is embedded
XSL-FO in
Defines the o
What is a select mode selection mode statement that extracts data from XML is a simple method to obtain data. these tags all have a select attribute, pay attention to the specific end-to-end data in XML. every xsl file needs to be imported into the xsl
What is the selection mode?The select mode statement extracts data from XML, which is a simple method to obtain data. all the tags have a select attribute an
Original article: JanEgilRefsnes translation: A Jie qi. XSL control statement 1. Conditional statement if... thenXSL also has conditional statements (haha ~~ It's amazing, like programming languages ). The specific syntax is to add an xsl: if element, like this xsl: ifmatch = .[
Original: Jan Egil RefsnesVII. XSL contr
A XSL-FO document is an XML file with output information. The XSL-FO document is an XML file with output information. They contain information about the output layout and output content. XSL-FO documents are stored in files suffixed with. fo or. fob. Take. xml
A XSL-FO document is an XML file with output information.
1. Get started with XSL
1. style sheet of XSL---XML
The HTML webpage uses a pre-defined identifier (TAGS), which means that all the tags have a clear meaning. For example, However, XML does not have fixed identifiers. We can create the identifiers we need, so browsers cannot Parse them automatically. For example, To control the display of XML documents, it is necessary to establish a mechanism. CSS is o
Original: Jan Egil Refsnes
Ii. XSL Conversion
1. Convert XML into HTML
How does XSL convert XML files into HTML files? Let's look at an example. below is part of the XML document:
...
Then, we use the following XSL file as an HTML template to convert XML data to an HTML file:
In the above Code, the
In the last period we talked about formatting XML documents with CSS (cascading style sheets), and the effect was not very satisfying. In fact, CSS is a good place to format HTML tags, just because it's simple to use in the example above.XML is just a data file in more time, how can it be changed into the HTML format that we see everyday? If we compare an XML file to a structured raw material, then the XSL is like "sieve" and "die", and the sieve choo
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.